//
//  FirstViewController.swift
//  Transition2
//
//  Created by Open on 2/3/15.
//  Copyright (c) 2015 open-groupe. All rights reserved.
//

import UIKit

class FirstViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        var swipeGuestureRecongnizer: UISwipeGestureRecognizer = UISwipeGestureRecognizer(target: self, action: "showSecondViewController")
        swipeGuestureRecongnizer.direction = UISwipeGestureRecognizerDirection.Up
        self.view.addGestureRecognizer(swipeGuestureRecongnizer)
        
        NSLog("hello ")
        
    }
    
    
    
    
    func showSecondViewController ()
    {
        self.performSegueWithIdentifier("idFirstSegue", sender: self)
    }
    
    override func segueForUnwindingToViewController(toViewController: UIViewController,fromViewController: UIViewController, identifier: String?) -> UIStoryboardSegue
    {
        if let id = identifier {
            if id == "idFirstSegueUnwind" {
                let unwindSegue = FirstCustomeSegueUnwind(identifier: id, source: fromViewController, destination: toViewController)
                return unwindSegue
            }
            if id == "idSecondSegueUnwind" {
                let unwindSegue = SecondCustonmeUnwindSegue(identifier: id, source: fromViewController, destination: toViewController)
                return unwindSegue
            }
        }
        return super.segueForUnwindingToViewController(toViewController,fromViewController: fromViewController, identifier: identifier )
    }
    
    @IBAction func returnFormSegueActions(sender: UIStoryboardSegue)
    {
         NSLog("first vc");
    }
}
